<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=9" />
		<meta http-equiv="pragma" content="no-cache" />
		<title>修改专题模版</title>
		<%@ include file="../../common/Admin-list.jsp"%>  
		
		<script type="text/javascript" src="<%=bpath %>Scripts/jquery/jquery.form.js"></script> 			 
		<script type="text/javascript">	
		var IconSize=24; //一级 菜单 24 二级 32
		
		$(function(){
			 $('#typeid').combobox({
			   	 url: '../subjectTemplate/queryAll.json?tableName=Site_AD',
			   	 valueField: 'id',
			   	 textField: 'typeName',
			   	 editable : true,
			   	 onSelect: function (rec) { 

			   	 },
			   	 onLoadSuccess: function () { 
			   		 
			        }
			   	 });
			 
			
			
			//保存
			$("#lnbSave").click(function(){		
				$("#addForm").ajaxSubmit({
					url:"../subjectTemplate/update.json",
					type:"POST",
					beforeSubmit:checkForm,
					contentType:"application/x-www-form-urlencoded;charset=UTF-8",
					error:function(){},
					success:function(data){
						if(data.success==true){
							showTip("保存成功，返回列表页面！","succeed");	
							var win = artDialog.open.origin;//来源页面
							win.art.dialog({id: 'editDialog'}).close();
							win.refresh();
						}else{
							art.dialog.alert('保存失败，请确认填写正确！');
						}
					},
				});
			});
		});
			
		function checkForm(){
			var flag=$('#addForm').form('validate');
			return true;
		}
				
		//消息提示  
		function showTip(mess,icon) {  
		    art.dialog({  
		        id : 'Tip',  
		        title : '消息',  
		        fixed : true,  
		        lock : true,  
		        opacity: .2,  
		        content : mess,  
		        icon : icon,  
		        time : 1  
		    });  
		    setTimeout('originReload()', 1000);  
		}  
		</script>
		
</head>
<body>
<!---->
<div>
	<div id="tab">
        <ul>
            <li class="Current">
            	<a href="#" onfocus="this.blur()">
            		<span id="lblTitle" >修改专题模版   </span>
            	</a>
            </li>
        </ul>
    </div>  
    <div id="menu">
        <ul>
            <li>
            	<a id="lnbSave"  onclick="lnbSave_Click">
            		<span><img src="<%=basePath %>pages/Admin/Images/Icon/save.gif" alt="Save" />保存</span>
            	</a>
            </li>
        </ul>
    </div>
    
    <div id="middle"> 
    <form action="../subjectTemplate/update.json" id="addForm" name="addForm" method="post"   enctype="multipart/form-data">   
    <div class="editor">
        <table class="eTable">
            <tr class="eTr">
                <td class="name">
                    <label id="Label1" >模版标题</label>
                </td>
                <td>
                <input id="id"  type="hidden" name="id" class="input"  value="${data.subjectTemplate.id }" ></input>
                
                	<input id="template_title" name="template_title" class="input"  value="${data.subjectTemplate.template_title }" ></input>
				</td>
            </tr>
            <tr class="eTr">
                <td class="name">
                    <label id="Label2" >模版文件</label></td>
                <td>
                    <input id="template_file" name="template_file" value="${data.subjectTemplate.template_file }" class="input" ></input>
                </td>
            </tr>         
         
          <tr class="eTr">
                <td class="name">
                    <label id="Label2" >模版标识</label></td>
                <td>
                    <input id="falg" name="falg" value="${data.subjectTemplate.falg }" class="input" ></input>
                </td>
            </tr>  
            
             <tr class="eTr">
                <td class="name">
                    <label id="Label2" >模版简介</label></td>
                <td>
                    <textarea id="summary" name="summary" class="input" style="height: 100px;" > ${data.subjectTemplate.summary }</textarea>
                </td>
            </tr>  
        </table>
      
        <div id="iconDiv"><img id="imgIcon" /></div>
    </div>
    </form> 
    </div>
</div>
</body>
</html>